﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Orbitone.MeetingRooms.RoomFinder
{
    public partial class LiveConnectUserControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["MeetingRooms"] == null)
            {
                

                login.NavigateUrl = Globals.ENDPOINT_OAUTH +
                    Globals.ENDPOINT_PATH_AUTHORIZE +
                    Globals.PARAM_CLIENT_ID +
                    Globals.APP_CLIENT_ID +
                    Globals.PARAM_SCOPE +
                    Globals.REQUESTED_SCOPES +
                    Globals.PARAM_RESPONSE_TYPE +
                    Globals.PARAM_RESPONSE_TYPE_CODE +
                    Globals.PARAM_REDIRECT_URI +
                    Globals.APP_REDIRECT_URI;
                login.Text = "Login";
            }
            else
            {
                name.Text = Request.Cookies["MeetingRooms"]["name"];
                login.NavigateUrl = "logout.aspx";
                login.Text = "Logout";
            }
                


        }
    }
}